<?php
 /*
　*　用户中心文件
*/ 
if(!defined('IN_CRONLITE'))exit();
$title="任务管理";
include_once(TEMPLATE_ROOT."head.php");


if($islogin==1){

$all_sys1=$DB->count("SELECT count(*) from wjob_job WHERE sysid='1'");
$all_sys2=$DB->count("SELECT count(*) from wjob_job WHERE sysid='2'");
$all_sys3=$DB->count("SELECT count(*) from wjob_job WHERE sysid='3'");
$all_sys4=$DB->count("SELECT count(*) from wjob_job WHERE sysid='4'");
$all_sys5=$DB->count("SELECT count(*) from wjob_job WHERE sysid='5'");
$all_sys6=$DB->count("SELECT count(*) from wjob_job WHERE sysid='6'");
$all_sys7=$DB->count("SELECT count(*) from wjob_job WHERE sysid='7'");
$all_sys8=$DB->count("SELECT count(*) from wjob_job WHERE sysid='8'");

$my_sys1=$DB->count("SELECT count(*) from wjob_job WHERE sysid='1' and lx='$gl'");
$my_sys2=$DB->count("SELECT count(*) from wjob_job WHERE sysid='2' and lx='$gl'");
$my_sys3=$DB->count("SELECT count(*) from wjob_job WHERE sysid='3' and lx='$gl'");
$my_sys4=$DB->count("SELECT count(*) from wjob_job WHERE sysid='4' and lx='$gl'");
$my_sys5=$DB->count("SELECT count(*) from wjob_job WHERE sysid='5' and lx='$gl'");
$my_sys6=$DB->count("SELECT count(*) from wjob_job WHERE sysid='6' and lx='$gl'");
$my_sys7=$DB->count("SELECT count(*) from wjob_job WHERE sysid='7' and lx='$gl'");
$my_sys8=$DB->count("SELECT count(*) from wjob_job WHERE sysid='8' and lx='$gl'");

$gls=$my_sys1+$my_sys2+$my_sys3+$my_sys4+$my_sys5+$my_sys6+$my_sys7+$my_sys8;
if($row['num']==$gls){}else{
$DB->query("UPDATE wjob_user SET num= '$gls' WHERE user = '$gl'");}

navi();

$gg=$conf['gg'];
if(!empty($gg))
echo'<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title" align="center">公告栏</h3></div><div class="panel-body">'.$gg.'</div></div>
';


echo'<div class="panel panel-primary">
<div class="panel-heading"><h3 class="panel-title" align="center">网络任务控制面板</h3></div>';
echo'<div class="panel-body">请从以下8个系统中选择一个总任务数较少的来添加你的网络任务。<br/>你可以在这里添加网址挂刷任务和网址签到任务，QQ挂机类任务请到ＱＱ管理中添加。<br/><br/>';
echo'
<div class="alert alert-info">你总共建立了'.$gls.'条任务 [<a href="index.php?mod=output">导出任务</a>]</div>';

$show=explode('|',$conf['show']);

echo '<div class="table-responsive"><table class="table table-hover"><thead><tr>';
echo '<th>任务系统</th><th>总任务数</th><th>你的任务</th><th>执行频率</th></thead><tbody>';

echo'<tr><td><a href="index.php?mod=list&sys=1'.$link.'">【系统①】</a></td><td>'.$all_sys1.'/'.$conf['max'].'</td><td>'.$my_sys1.'</td><td><font color=#0000FF>'.$show[0].'</font></td></tr>';
if($conf['sysnum']>='2'){
echo'<tr><td><a href="index.php?mod=list&sys=2'.$link.'">【系统②】</a></td><td>'.$all_sys2.'/'.$conf['max'].'</td><td>'.$my_sys2.'</td><td><font color=#0000FF>'.$show[1].'</font></td></tr>';}
if($conf['sysnum']>='3'){
echo'<tr><td><a href="index.php?mod=list&sys=3'.$link.'">【系统③】</a></td><td>'.$all_sys3.'/'.$conf['max'].'</td><td>'.$my_sys3.'</td><td><font color=#871F78>'.$show[2].'</font></td></tr>';}
if($conf['sysnum']>='4'){
echo'<tr><td><a href="index.php?mod=list&sys=4'.$link.'">【系统④】</a></td><td>'.$all_sys4.'/'.$conf['max'].'</td><td>'.$my_sys4.'</td><td><font color=#871F78>'.$show[3].'</font></td></tr>';}
if($conf['sysnum']>='5'){
echo'<tr><td><a href="index.php?mod=list&sys=5'.$link.'">【系统⑤】</a></td><td>'.$all_sys5.'/'.$conf['max'].'</td><td>'.$my_sys5.'</td><td><font color=#871F78>'.$show[4].'</font></td></tr>';}
if($conf['sysnum']>='6'){
echo'<tr><td><a href="index.php?mod=list&sys=6'.$link.'">【系统⑥】</a></td><td>'.$all_sys6.'/'.$conf['max'].'</td><td>'.$my_sys6.'</td><td><font color=#A67D3D>'.$show[5].'</font></td></tr>';}
if($conf['sysnum']>='7'){
echo'<tr><td><a href="index.php?mod=list&sys=7'.$link.'">【系统⑦】</a></td><td>'.$all_sys7.'/'.$conf['max'].'</td><td>'.$my_sys7.'</td><td><font color=#A67D3D>'.$show[6].'</font></td></tr>';}
if($conf['sysnum']>='8'){
echo'<tr><td><a href="index.php?mod=list&sys=8'.$link.'">【系统⑧】</a></td><td>'.$all_sys8.'/'.$conf['max'].'</td><td>'.$my_sys8.'</td><td><font color=#A67D3D>'.$show[7].'</font></td></tr>';}
echo'</tbody></table></div></div></div>';
echo '<div class="panel panel-primary"><div class="panel-heading"><h3 class="panel-title">运行日志:&nbsp&nbsp<a href="index.php?mod=all">详细>></a></h3></div><div class="panel-body">系统共有<font color="#ff0000">'.$zongs.'</font>条任务<br>系统累计运行了<font color="#ff0000">'.$info['times'].'</font>次<br>上次运行:<font color="#ff0000">'.$info['last'].'</font><br>当前时间:<font color="#ff0000">'.$date.'</font></div>';
if(function_exists("sys_getloadavg")){
echo'<div class="panel-heading"><h3 class="panel-title">系统负载:</h3></div>';
$f=sys_getloadavg();
echo'<div class="panel-body">';
echo"1min:{$f[0]}";
echo"|5min:{$f[1]}";
echo"|15min:{$f[2]}";
echo'</div>';}
echo'</div>';
  }
else{
showmsg('登录失败，可能是密码错误或者身份失效了，请<a href="index.php?mod=login">重新登录</a>！',3);}

echo'<div class="copy">';
include(ROOT.'includes/foot.php');
echo'</div>';
if($conf['sjyl']==1)
{$txt=file(ROOT.'includes/content/content.db');
shuffle($txt);
echo"$txt[0]";}
echo'</div></div></div></body></html>';
?>